{% extends "admin_base.html" %}

{% block title %}文章列表{% endblock %}

{% block content %}


  {% if article_list %}
    <ul class="menu">
      <a href="/admin/article/create/">写新文章</a>
    </ul>

    <table class="form-table">
      <tr>
        <th>标题</th>
        <th>分类目录</th>
        <th>发布日期</th>
        <th>修改日期</th>
        <th>作者</th>
        <th>操作</th>
      </tr>

      {% for article in article_list %}
        <tr>
          <td><a href="/article/{{ article.slug }}/">{{ article.title }}</a></td>
          <td>{{ article.category }}</td>
          <td>{{ article.publish_date.date }}</td>
          <td>{{ article.last_modify_date.date }}</td>
          <td>{{ article.author }}</td>
        
          <td>
            <a href="/admin/article/update/{{ article.id }}/">编辑</a> |
            <a href="/admin/article/delete/{{ article.id }}/">删除</a>
          </td>
        </tr>
      {% endfor %}
    </table>
    <span><p>共{{ article_count }}篇文章。 </p></span>
    <div>{% include "pagination.html" %}</div>
  {% else %}
    <p>没有找到文章，<a href="/admin/article/create/">写一篇</a></p>
  {% endif %}
{% endblock %}
